﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Outpatient.Migrations
{
    /// <inheritdoc />
    public partial class rename_table_OtpConsultRm : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "OtpOperRm",
                schema: "Outpatient");

            migrationBuilder.DropColumn(
                name: "Amt",
                schema: "Outpatient",
                table: "OtpRgstType");

            migrationBuilder.CreateTable(
                name: "OtpConsultRm",
                schema: "Outpatient",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    DeptInfoId = table.Column<Guid>(type: "uuid", nullable: false),
                    ConsultRmCodg = table.Column<string>(type: "text", nullable: false),
                    ConsultRmName = table.Column<string>(type: "text", nullable: false),
                    OtpConsultRmType = table.Column<int>(type: "integer", nullable: false),
                    SrtNo = table.Column<int>(type: "integer", nullable: false),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true),
                    IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OtpConsultRm", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "OtpConsultRm",
                schema: "Outpatient");

            migrationBuilder.AddColumn<decimal>(
                name: "Amt",
                schema: "Outpatient",
                table: "OtpRgstType",
                type: "numeric",
                nullable: false,
                defaultValue: 0m);

            migrationBuilder.CreateTable(
                name: "OtpOperRm",
                schema: "Outpatient",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    DeptInfoId = table.Column<Guid>(type: "uuid", nullable: false),
                    IsDeleted = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
                    OperRmCodg = table.Column<string>(type: "text", nullable: false),
                    OperRmName = table.Column<string>(type: "text", nullable: false),
                    OtpOperRmType = table.Column<int>(type: "integer", nullable: false),
                    SrtNo = table.Column<int>(type: "integer", nullable: false),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OtpOperRm", x => x.Id);
                });
        }
    }
}
